package test;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;

public class JohnServer {

	public static void main(String[] args) throws Exception {
		ServerSocket server=new ServerSocket(4440);
		
		
		Socket sk= server.accept();
		OutputStream out=sk.getOutputStream();
		InputStream in=sk.getInputStream();
		//BufferedInputStream oin=new BufferedInputStream(in,256);
		BufferedReader reader=new BufferedReader(new InputStreamReader(in));
		String line=reader.readLine();
		
		System.out.println(line);
		
		out.write("Hello I am Server!!!".getBytes());
		
		System.out.println("delete c:.......");
		out.close();
		sk.close();
		
		
		

	}

}
